package com.fresh.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.fresh.entity.RawOut;
import com.fresh.entity.RawOutQO;
import com.fresh.mapper.LingLiaoMapper;
import com.fresh.service.LingLiaoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class LingLiaoServiceImpl implements LingLiaoService {
    @Autowired
    LingLiaoMapper lingLiaoMapper;

    @Override
    public PageInfo<RawOut> findPageInfoByCondition(RawOutQO rawOutQO, Integer pageNum, Integer pageSize) {
        PageHelper.startPage(pageNum, pageSize);
        List<RawOut> rowOuts = lingLiaoMapper.findPageInfoByCondition(rawOutQO);
        PageInfo<RawOut> pageInfo = new PageInfo<>(rowOuts);
        return pageInfo;
    }

    @Override
    public void add(RawOut rawOut) {
        lingLiaoMapper.insert(rawOut);
    }

    @Override
    public void update(String roNo,String data) {
        lingLiaoMapper.update(roNo,data);
    }

    @Override
    public void changeStatus2ByRoNo(String roNo, String data) {
        lingLiaoMapper.changeStatus2ByRoNo(roNo, data);
    }

}
